The source for Luigi Belverato’s August Tip of the Month, which changed the status of a patch via the Gestalt Manager, was printed incorrectly. The correct sources are at all the usual places, and on the source diskette. To correct the sources by hand, replace all occurences of “= 3D” (that’s equal sign, space, three, capital D) and “=3D” (without a space) with “=” (no spaces).
While developing an init that installs a system wide patch I needed a simple way to enable or disable it (forcing it to call the original patch) from the controlling application.
I found that the Gestalt manager could come in useful. In fact the procedure that installs a new selector, used in this case to check for the existence of the init, requires you to specify a response function which gets executed whenever the new selector is called. Being the function itself is part of the init, it is able to change the value of a status variable and return its state: assuming that the variable is a boolean. With two gestalt calls (max) it is possible to change the patch status. Follow some code fragments: